<?php
	header("Content-Type: text/html;charset=utf-8");
	include("../_judge.php");
	include("../../function/function.php");
	
	$id = chkstr(trim($_REQUEST['id']));
	if(!is_numeric($id)){
		echo erro("ID错误");
	}
	
	$news_sql = "select * from kboy_trailfoot where id=$id";
	$news_rows = mysql_query($news_sql);
	$news_nums = mysql_num_rows($news_rows);
	if($news_nums > 0){
		$news_rs = mysql_fetch_array($news_rows);
		$trailfoot_title = $news_rs['trailfoot_title'];
		$trailfoot_pic = $news_rs['trailfoot_pic'];
		$trailfoot_pic2 = $news_rs['trailfoot_pic2'];
		$trailfoot_pic3 = $news_rs['trailfoot_pic3'];
		$trailfoot_pic4 = $news_rs['trailfoot_pic4'];
		$trailfoot_startime = $news_rs['trailfoot_startime'];
		$trailfoot_duration = $news_rs['trailfoot_duration'];
		$trailfoot_line = $news_rs['trailfoot_line'];
		$trailfoot_allline = $news_rs['trailfoot_allline'];
		$trailfoot_power = $news_rs['trailfoot_power'];
		$trailfoot_rise = $news_rs['trailfoot_rise'];
		$trailfoot_drop = $news_rs['trailfoot_drop'];
		$trailfoot_taltitude = $news_rs['trailfoot_taltitude'];
		$trailfoot_baltitude = $news_rs['trailfoot_baltitude'];
		$trailfoot_speed = $news_rs['trailfoot_speed'];
		$trailfoot_writer = $news_rs['trailfoot_writer'];
		$trailfoot_text = $news_rs['trailfoot_text'];
		
		$trailfoot_map = stripslashes($news_rs['trailfoot_map']);
		$trailfoot_about = stripslashes($news_rs['trailfoot_about']);
		$trailfoot_footline = stripslashes($news_rs['trailfoot_footline']);
		$trailfoot_foot = stripslashes($news_rs['trailfoot_foot']);
	}else{
		echo erro("该信息已经被删除或不存在");
	}
	
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?= $adminweb_titles ?></title>
<link href="../css/style.css" rel="stylesheet" type="text/css" />
<script>if (top.location != parent.location||self.location==top.location){top.location.replace('../login/admin.php')}</script>
<script language="javascript" src="../script/jquery-1.7.2.min.js"></script>
<script language="javascript" src="../script/My97DatePicker/WdatePicker.js"></script>
<link rel="stylesheet" href="../../SunbeamEditor/themes/default/default.css" />
<script charset="utf-8" src="../../SunbeamEditor/kindeditor.js"></script>
<script charset="utf-8" src="../../SunbeamEditor/lang/zh_CN.js"></script>
<script language="javascript">
	KindEditor.ready(function(K) {
		var editor = K.create('textarea[name="trailfoot_map"]', {
			cssPath : '../../SunbeamEditor/plugins/code/prettify.css',
			uploadJson : '../../SunbeamEditor/php/upload_json.php',
			fileManagerJson : '../../SunbeamEditor/php/file_manager_json.php',
			allowFileManager : false,
			afterBlur: function(){this.sync();}
		});
		var editor1 = K.create('textarea[name="trailfoot_about"]', {
			cssPath : '../../SunbeamEditor/plugins/code/prettify.css',
			uploadJson : '../../SunbeamEditor/php/upload_json.php',
			fileManagerJson : '../../SunbeamEditor/php/file_manager_json.php',
			allowFileManager : false,
			afterBlur: function(){this.sync();}
		});
		var editor2 = K.create('textarea[name="trailfoot_footline"]', {
			cssPath : '../../SunbeamEditor/plugins/code/prettify.css',
			uploadJson : '../../SunbeamEditor/php/upload_json.php',
			fileManagerJson : '../../SunbeamEditor/php/file_manager_json.php',
			allowFileManager : false,
			afterBlur: function(){this.sync();}
		});
		var editor3 = K.create('textarea[name="trailfoot_foot"]', {
			cssPath : '../../SunbeamEditor/plugins/code/prettify.css',
			uploadJson : '../../SunbeamEditor/php/upload_json.php',
			fileManagerJson : '../../SunbeamEditor/php/file_manager_json.php',
			allowFileManager : false,
			afterBlur: function(){this.sync();}
		});
		
		
		

		/////   点击上传图片
		var editor = K.editor({
			allowFileManager : false
		});
		K('#image1').click(function() {
			editor.loadPlugin('image', function() {
				editor.plugin.imageDialog({
					imageUrl : K('#trailfoot_pic').val(),
					clickFn : function(url, title, width, height, border, align) {
						K('#trailfoot_pic').val(url);
						editor.hideDialog();
					}
				});
			});
		});
		K('#image2').click(function() {
			editor.loadPlugin('image', function() {
				editor.plugin.imageDialog({
					imageUrl : K('#trailfoot_pic2').val(),
					clickFn : function(url, title, width, height, border, align) {
						K('#trailfoot_pic2').val(url);
						editor.hideDialog();
					}
				});
			});
		});
		K('#image3').click(function() {
			editor.loadPlugin('image', function() {
				editor.plugin.imageDialog({
					imageUrl : K('#trailfoot_pic3').val(),
					clickFn : function(url, title, width, height, border, align) {
						K('#trailfoot_pic3').val(url);
						editor.hideDialog();
					}
				});
			});
		});
		K('#image4').click(function() {
			editor.loadPlugin('image', function() {
				editor.plugin.imageDialog({
					imageUrl : K('#trailfoot_pic4').val(),
					clickFn : function(url, title, width, height, border, align) {
						K('#trailfoot_pic4').val(url);
						editor.hideDialog();
					}
				});
			});
		});
		
		
});

$(document).ready(function(){
	
	$("#myform").submit(function(){
		var trailfoot_title = $("#trailfoot_title").val();

		if (trailfoot_title.replace(/\ /g,"").length<1){
			alert("信息标题不能为空！");
			$("#trailfoot_title").focus();
			return false;
		}
	});
});
</script>



</head>

<body>
<table width="97%" border="0" align="center" cellpadding="5" cellspacing="0">
  <tr>
    <td><strong>后台管理</strong>&nbsp;-&nbsp;<span class="hong"><strong>目的地足迹添加</strong></span></td>
  </tr>

</table>
<form id="myform" name="myform" method="post" action="newsaddsave.php?action=edit">
<table width="97%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#333333">
    <tr>
      <td width="80" align="right" bgcolor="#EFEFEF">信息标题：</td>
      <td colspan="3" bgcolor="#EFEFEF"><input name="trailfoot_title" type="text" id="trailfoot_title" value="<?=$trailfoot_title?>" size="50" />
      &nbsp;<span class="hong">*
      <input name="id" type="hidden" id="id" value="<?=$id?>" />
      <input name="re_url" type="hidden" id="re_url" value="<?=$_SERVER['HTTP_REFERER']?>" />
      </span></td>
    </tr>
    <tr>
      <td align="right" bgcolor="#EFEFEF">出发时间：</td>
      <td width="327" bgcolor="#EFEFEF"><input name="trailfoot_startime" type="text" id="trailfoot_startime" value="<?=$trailfoot_startime?>" size="38" /></td>
      <td width="112" align="right" bgcolor="#EFEFEF">历时：</td>
      <td width="742" bgcolor="#EFEFEF"><input name="trailfoot_duration" type="text" id="trailfoot_duration" value="<?=$trailfoot_duration?>" size="38" /></td>
    </tr>
    <tr>
      <td align="right" bgcolor="#EFEFEF">线路：</td>
      <td bgcolor="#EFEFEF"><input name="trailfoot_line" type="text" id="trailfoot_line" value="<?=$trailfoot_line?>" size="38" /></td>
      <td align="right" bgcolor="#EFEFEF">全程：</td>
      <td bgcolor="#EFEFEF"><input name="trailfoot_allline" type="text" id="trailfoot_allline" value="<?=$trailfoot_allline?>" size="38" /></td>
    </tr>
    <tr>
      <td align="right" bgcolor="#EFEFEF">强度等级：</td>
      <td bgcolor="#EFEFEF"><input name="trailfoot_power" type="text" id="trailfoot_power" value="<?=$trailfoot_power?>" size="38" /></td>
      <td align="right" bgcolor="#EFEFEF">累计上升：</td>
      <td bgcolor="#EFEFEF"><input name="trailfoot_rise" type="text" id="trailfoot_rise" value="<?=$trailfoot_rise?>" size="38" /></td>
    </tr>
    <tr>
      <td align="right" bgcolor="#EFEFEF">累计下降：</td>
      <td bgcolor="#EFEFEF"><input name="trailfoot_drop" type="text" id="trailfoot_drop" value="<?=$trailfoot_drop?>" size="38" /></td>
      <td align="right" bgcolor="#EFEFEF">最低海拔：</td>
      <td bgcolor="#EFEFEF"><input name="trailfoot_baltitude" type="text" id="trailfoot_baltitude" value="<?=$trailfoot_baltitude?>" size="38" /></td>
    </tr>
    <tr>
      <td align="right" bgcolor="#EFEFEF">最高海拔：</td>
      <td bgcolor="#EFEFEF"><input name="trailfoot_taltitude" type="text" id="trailfoot_taltitude" value="<?=$trailfoot_taltitude?>" size="38" /></td>
      <td align="right" bgcolor="#EFEFEF">最高时速：</td>
      <td bgcolor="#EFEFEF"><input name="trailfoot_speed" type="text" id="trailfoot_speed" value="<?=$trailfoot_speed?>" size="38" /></td>
    </tr>
    <tr>
      <td align="right" bgcolor="#EFEFEF">概述：</td>
      <td colspan="3" bgcolor="#EFEFEF"><textarea name="trailfoot_text" cols="70" rows="4" id="trailfoot_text"><?=$trailfoot_text?></textarea></td>
    </tr>
    <tr>
      <td align="right" bgcolor="#EFEFEF">作者：</td>
      <td colspan="3" bgcolor="#EFEFEF"><input name="trailfoot_writer" type="text" id="trailfoot_writer" value="<?=$trailfoot_writer?>" size="25" /></td>
    </tr>
    <tr>
      <td align="right" bgcolor="#EFEFEF">上传图片：</td>
      <td colspan="3" bgcolor="#EFEFEF"><input name="trailfoot_pic" type="text" id="trailfoot_pic" value="<?=$trailfoot_pic?>" size="25" />
        <input name="button" type="button" id="image1" value="选择图片" /></td>
    </tr>
    <tr>
      <td align="right" bgcolor="#EFEFEF">地图线路：</td>
      <td colspan="3" bgcolor="#EFEFEF"><input name="trailfoot_pic2" type="text" id="trailfoot_pic2" value="<?=$trailfoot_pic2?>" size="25" />
        <input name="button" type="button" id="image2" value="选择图片" /></td>
    </tr>
    <tr>
      <td align="right" bgcolor="#EFEFEF">地图线路：</td>
      <td colspan="3" bgcolor="#EFEFEF"><input name="trailfoot_pic3" type="text" id="trailfoot_pic3" value="<?=$trailfoot_pic3?>" size="25" />
        <input name="button" type="button" id="image3" value="选择图片" /></td>
    </tr>
    <tr>
      <td align="right" bgcolor="#EFEFEF">地图线路：</td>
      <td colspan="3" bgcolor="#EFEFEF"><input name="trailfoot_pic4" type="text" id="trailfoot_pic4" value="<?=$trailfoot_pic4?>" size="25" />
        <input name="button" type="button" id="image4" value="选择图片" /></td>
    </tr>
    <tr>
      <td align="right" bgcolor="#EFEFEF">目的地地图：</td>
      <td colspan="3" bgcolor="#EFEFEF"><textarea name="trailfoot_map" style="width:680px;height:350px;visibility:hidden;"><?=htmlspecialchars($trailfoot_map)?></textarea></td>
    </tr>
    <tr>
      <td align="right" bgcolor="#EFEFEF">目的地简介：</td>
      <td colspan="3" bgcolor="#EFEFEF"><textarea name="trailfoot_about" style="width:680px;height:350px;visibility:hidden;"><?=htmlspecialchars($trailfoot_about)?></textarea></td>
    </tr>
    <tr>
      <td align="right" bgcolor="#EFEFEF">步道线路：</td>
      <td colspan="3" bgcolor="#EFEFEF"><textarea name="trailfoot_footline" style="width:680px;height:350px;visibility:hidden;"><?=htmlspecialchars($trailfoot_footline)?></textarea></td>
    </tr>
    <tr>
      <td align="right" bgcolor="#EFEFEF">足迹：</td>
      <td colspan="3" bgcolor="#EFEFEF"><textarea name="trailfoot_foot" style="width:680px;height:350px;visibility:hidden;"><?=htmlspecialchars($trailfoot_foot)?></textarea></td>
    </tr>
    <tr>
      <td bgcolor="#EFEFEF">&nbsp;</td>
      <td colspan="3" bgcolor="#EFEFEF"><input type="submit" name="Submit" value="提交保存" />
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <input type="reset" name="Submit2" value="重置取消" /></td>
    </tr>
</table>
</form>
</body>
</html>
